/**
 *
 * @author rothens
 */
/*
 * Copyright (C) 2012 rothens
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package rpg.entities;

import java.awt.image.BufferedImage;
import rpg.Location;
import rpg.entities.ai.AIPeacefulRandomMovement;
import rpg.gfx.Bitmap;
import rpg.util.ImageUtil;

/**
 *
 * @author rothens
 */
public class Ram  extends Critter {
    
    private Bitmap[] bitmaps;

    public Ram(Location loc) {
        super(1, loc);
        bitmaps = new Bitmap[12];
        BufferedImage image = ImageUtil.createImageIcon("/res/entities/ram.png");
        for (int i = 0; i < 12; i++) {
            int col = i % 3;
            int row = i / 3;
            bitmaps[i] = new Bitmap(64, 64);
            image.getSubimage(col * 64, row * 64, 64, 64).getRGB(0, 0, bitmaps[i].width, bitmaps[i].height, bitmaps[i].pixels, 0, bitmaps[i].width);
        }
        entityAI = new AIPeacefulRandomMovement(this);
    }

    @Override
    public Bitmap getDrawGraphics() {
        return bitmaps[entityAI.getAnimState() % 3 + entityAI.getDir() * 3];
    }
    
}

